import pandas
import pathlib
import os
import tkinter.filedialog
import shutil
import uuid

# 初始的运行路径
InitRunPath = os.getcwd()

# 获取当前脚本所在的路径
CurrentPath = pathlib.Path(__file__).parent.absolute().resolve().__str__()

# 获取当前用户的桌面路径
desktop_path = os.path.join(os.path.expanduser("~"), "Desktop")

# 切换运行路径到脚本所在路径
os.chdir(CurrentPath)

# 获取增强助手的评价文件夹
folder_path = tkinter.filedialog.askdirectory(
    title="选择文件夹",
    initialdir=CurrentPath
)

# 获取路径下所有的文件夹
ment_list = list()
for root,dirs,files in os.walk(folder_path):
    for single_dir in dirs:
        path = os.path.join(root,single_dir)
        ment_list.append(path)
    break

# 对目录下的所有评价文件进行一个打乱处理
for single_path in ment_list:
    # 扫描所有的文件夹
    for root,dirs,files in os.walk(single_path):
        for single_dir in dirs:
            oldpath = os.path.join(root,single_dir)
            newpath = os.path.join(root,str(uuid.uuid4()))
            os.rename(oldpath,newpath)